import time
import socket
import sys
host = "127.0.0.1"
port = 50000

s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host,port))

buf = s.recv(4096)
print buf
data = 'stop'
s.sendall(data)
s.shutdown(1)
time.sleep(0.4)
print "send ok"
s.close()
